package com.foreknow.elmboot.service.impl;

import com.foreknow.elmboot.mapper.DeliveryAddressMapper;
import com.foreknow.elmboot.po.DeliveryAddress;
import com.foreknow.elmboot.service.DeliveryAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeliveryAddressServiceImpl implements DeliveryAddressService {

    @Autowired
    private DeliveryAddressMapper deliveryAddressMapper;

    @Override
    public List<DeliveryAddress> squeryById(String userId) {
        return deliveryAddressMapper.queryById(userId);
    }

    @Override
    public DeliveryAddress squeryDABbId(Integer daId) {
        return deliveryAddressMapper.queryDABbId(daId);
    }

    @Override
    public int sinsert(String contactName, Integer contactSex, String contactTel, String address, String userId) {
        return deliveryAddressMapper.insert(contactName,contactSex,contactTel,address,userId);
    }

    @Override
    public int supdate(DeliveryAddress deliveryAddress) {
        return deliveryAddressMapper.update(deliveryAddress);
    }

    @Override
    public int sdelete(Integer daId) {
        return deliveryAddressMapper.delete(daId);
    }
}
